#include<stdio.h>
#define max 5

int main()
{
	int a[max],b[max];
	int i,*pa,*pb;
	printf("input array a with 5 element\n");
	for(i=0;i<max;i++)
	scanf("%d",&a[i]);
	
	printf("input array b with 5 element\n");
	for(i=0;i<max;i++)
	scanf("%d",&b[i]);
	pa=a;
	pb=b;
	for(i=1;i<max;i++)
	{
		if(*pa<a[i])
			pa=&a[i];
		if(*pb<b[i])
			pb=&b[i];
	}
	printf("The max numbers are %d and %d\n",*pa,*pb);
	
	printf("\npa:%p pb:%p\n",pa,pb);
	
	int temp=*pa;
	//printf("temp:%d\n",*temp);
	*pa=*pb;
	*pb=temp;
	printf("\npa:%p pb:%p\n",pa,pb);
	
	printf("new a:");
	for(i=0;i<max;i++)
	{
		printf(" %d",a[i]);
	}
	
	printf("\nnew b:");
	for(i=0;i<max;i++)
	{
		printf(" %d",b[i]);
	}
	printf("\n");
	return 0;
}
